#include <stddef.h>
#include <stdint.h>
#include "app.h"
#ifdef USE_CUSTOM_CERTIFICATES
const uint8_t custom_root_certificate[] =
  "-----BEGIN CERTIFICATE-----\n"
  "MIIBgDCCASagAwIBAgIUC/XJConsD7MbWsTtmPzERPD9rPEwCgYIKoZIzj0EAwIw\n"
  "MzELMAkGA1UEBhMCVVMxFTATBgNVBAoMDFNpbGljb24gTGFiczENMAsGA1UEAwwE\n"
  "Um9vdDAgFw0yMTEwMDkyMzM5NDFaGA8yMTIxMDkxNTIzMzk0MVowMzELMAkGA1UE\n"
  "BhMCVVMxFTATBgNVBAoMDFNpbGljb24gTGFiczENMAsGA1UEAwwEUm9vdDBZMBMG\n"
  "ByqGSM49AgEGCCqGSM49AwEHA0IABFv2XknkETne25jxaQ0fK2+Pa6cpvwvuF0Qn\n"
  "dbKCKOI36VwJw9tHiimlCeSkpwO8N6hSUIHlNZadCT2K5Tdm0vWjFjAUMBIGA1Ud\n"
  "EwEB/wQIMAYBAf8CAQIwCgYIKoZIzj0EAwIDSAAwRQIgNxpI799Z4qXw19j7Vlup\n"
  "vH15Z43ACiveyuUk1Jd6KtICIQCH+rYlhR4iWfxcCIFxe3JykItUf4uwSTosP8E1\n"
  "HS0fPTAIMAYGBFUdJQA=\n"
  "-----END CERTIFICATE-----\n";

const uint8_t custom_factory_certificate[] =
  "-----BEGIN CERTIFICATE-----\n"
  "MIIBizCCATGgAwIBAgIUCpwgWHTrJUqHSdkg2lpDjsERdUcwCgYIKoZIzj0EAwIw\n"
  "MzELMAkGA1UEBhMCVVMxFTATBgNVBAoMDFNpbGljb24gTGFiczENMAsGA1UEAwwE\n"
  "Um9vdDAgFw0yMTEwMDkyMzM5NDFaGA8yMTIxMDkxNTIzMzk0MVowPjELMAkGA1UE\n"
  "BhMCVVMxHTAbBgNVBAoMFFNpbGljb24gTGFicyBGYWN0b3J5MRAwDgYDVQQDDAdG\n"
  "YWN0b3J5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzC8fkyRYkvcaniewxoLl\n"
  "VbEHfZC4jdSsPf051ukkphis8MV4qpFJ+vi7VrJCCcTybHaKUdbbWDjM1kRk6lop\n"
  "6aMWMBQwEgYDVR0TAQH/BAgwBgEB/wIBATAKBggqhkjOPQQDAgNIADBFAiEAxso2\n"
  "/RNsZzrXJ6t2WIDgBnoT4WRb+taEMc10hWiIyiQCIAECeoXvQY8Au/aSKFzRmmug\n"
  "Gbl+bRsnc3G78HkTDzSTMAgwBgYEVR0lAA==\n"
  "-----END CERTIFICATE-----\n";

/*need secure boot to guarantee tamper resistance on these certs*/
const uint8_t custom_batch_certificate[] =
  "-----BEGIN CERTIFICATE-----\n"
  "MIIBljCCATygAwIBAgIUcyYT04kBcwG71iMdwQbrs0xdNhQwCgYIKoZIzj0EAwIw\n"
  "PjELMAkGA1UEBhMCVVMxHTAbBgNVBAoMFFNpbGljb24gTGFicyBGYWN0b3J5MRAw\n"
  "DgYDVQQDDAdGYWN0b3J5MCAXDTIxMTAwOTIzMzk0MVoYDzIxMjEwOTE1MjMzOTQx\n"
  "WjA+MQswCQYDVQQGEwJVUzEdMBsGA1UECgwUU2lsaWNvbiBMYWJzIEZhY3Rvcnkx\n"
  "EDAOBgNVBAMMB0JhdGNoIDEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQaC4YK\n"
  "CD4aQ0+44ZVuLgvT1UsqKn1gCdm70IQ+ZrHr2CMAsX5LEl+8BIJiDtAZ8Ss2PBr9\n"
  "vBdm70eSVGX3x+cgoxYwFDASBgNVHRMBAf8ECDAGAQH/AgEAMAoGCCqGSM49BAMC\n"
  "A0gAMEUCIQCzxpqR82WIGcqhu2T+clx+9PiLkP9h1ZsQUcox5xgDwQIgLejXoV3s\n"
  "+RjfujzZa4PcGWmDbuQG7wyVfGXbWVhDukswCDAGBgRVHSUA"
  "-----END CERTIFICATE-----\n";

const uint8_t custom_device_certificate[] =
  "-----BEGIN CERTIFICATE-----\n"
  "MIIBlzCCATygAwIBAgIUWOnXJ7lmTmj+YChvMQqEic5OHBQwCgYIKoZIzj0EAwIw\n"
  "PjELMAkGA1UEBhMCVVMxHTAbBgNVBAoMFFNpbGljb24gTGFicyBGYWN0b3J5MRAw\n"
  "DgYDVQQDDAdCYXRjaCAxMCAXDTIxMTAwOTIzMzk0MloYDzIxMjEwOTE1MjMzOTQy\n"
  "WjBEMQswCQYDVQQGEwJVUzEdMBsGA1UECgwUU2lsaWNvbiBMYWJzIEZhY3Rvcnkx\n"
  "FjAUBgNVBAMMDVNhbXBsZSBEZXZpY2UwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC\n"
  "AATxEaD6th33+JwKHBcNhCxoo5BsW+4ClVjNqjzo1wQoY+mg+XRXozHThLZ5DjGY\n"
  "3VwFNufSgRQOwcIP6pL6WbXeoxAwDjAMBgNVHRMBAf8EAjAAMAoGCCqGSM49BAMC\n"
  "A0kAMEYCIQDTmu1up/DiRBvOkZDl44aNtuFPisUaiC2f3SauQuuwiwIhAKDgpuBu\n"
  "SR9xxgjQjIvQkHKhDzP+xOnJ+UDveGyOIZoKMAgwBgYEVR0lAA==\n"
  "-----END CERTIFICATE-----\n";

#define DEVICE_CERT  custom_device_certificate
#define BATCH_CERT   custom_batch_certificate
#define FACTORY_CERT custom_factory_certificate
#define ROOT_CERT    custom_root_certificate

#else
static const uint8_t factory[] =
  "-----BEGIN CERTIFICATE-----\n"
  "MIICEjCCAbmgAwIBAgIIJNx7QAwynAowCgYIKoZIzj0EAwIwQjEXMBUGA1UEAwwO\n"
  "RGV2aWNlIFJvb3QgQ0ExGjAYBgNVBAoMEVNpbGljb24gTGFicyBJbmMuMQswCQYD\n"
  "VQQGEwJVUzAgFw0xODEwMTAxNzMzMDBaGA8yMTE4MDkxNjE3MzIwMFowOzEQMA4G\n"
  "A1UEAwwHRmFjdG9yeTEaMBgGA1UECgwRU2lsaWNvbiBMYWJzIEluYy4xCzAJBgNV\n"
  "BAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQc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TArMCmgJ6AlhiNodHRwOi8vY2Eu\n"
  "c2lsYWJzLmNvbS9kZXZpY2Vyb290LmNybDAdBgNVHQ4EFgQUEIsKPs10dZT0TIQi\n"
  "zY4ipKsxpUIwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA0cAMEQCIGlwr4G7\n"
  "IkG/9XHHk1WPthnY/yNNIzP9pThZkg2zU88ZAiBkAhsPaMKE7NOwWQIBgxy9nevX\n"
  "c7VKkqNr4UAU5zPbxg==\n"
  "-----END CERTIFICATE-----\n";

#define DEVICE_CERT
#define BATCH_CERT
#define FACTORY_CERT factory
#define ROOT_CERT    root
#endif
